function [priori1, priori2, posteriori1, posteriori2, errors, Vnorm] =...
    q2a(train_patterns, train_targets, test_patterns, test_targets)
    
      
    [t, params_ML] = ML(train_patterns, train_targets,...
        test_patterns, []);
    
    [t,params_EM] = EM(train_patterns, train_targets,...
        test_patterns, [1 2]);
    
    priori1 = params_ML(1).p;
    priori2 = params_ML(2).p;
    
    params_EM(2).p = priori2;
    params_final = [params_ML(1) params_EM(2)];
    params_final(1).w = 1;
    
    [resultTargets, V, Vnorm] = classify_paramteric(params_final,...
        test_patterns);
    
    posteriori1 = length(find(resultTargets==0))/length(resultTargets);
    posteriori2 = length(find(resultTargets==1))/length(resultTargets);
    
    errors = calculateError(resultTargets, test_targets);
end